import ContactsData from "./contacts";
import UserData from "./user";
const generateRandId = () => {
  return Math.random()
    .toString(36)
    .substr(-8);
};
const getContact = id => {
  const data = ContactsData.find(contact => contact.id == id);
  return { id: data.id, avatar: data.avatar, displayName: data.displayName };
};
export default {
  1: [
    {
      id: generateRandId(),
      status: "succeed",
      type: "text",
      sendTime: 1679019625951,
      content: "医生，咨询一个问题",
      toContactId: 1,
      fromUser: UserData,
    },
    {
      id: generateRandId(),
      status: "succeed",
      type: "text",
      sendTime: 1679019625951,
      content: "什么问题。",
      toContactId: 1,
      fromUser: getContact(1),
    },
    {
      id: generateRandId(),
      status: "succeed",
      type: "text",
      sendTime: 1679019625951,
      content: "今天突然发烧，不会是新冠吧",
      toContactId: 1,
      fromUser: UserData,
    },
    {
      id: generateRandId(),
      status: "succeed",
      type: "text",
      sendTime: 1679019625951,
      content: "目前新冠已消除，你可能是甲流，注意休息",
      toContactId: 1,
      fromUser: getContact(1),
    },
    {
      id: generateRandId(),
      status: "succeed",
      type: "text",
      sendTime: 1679019625951,
      content: "好的",
      toContactId: 1,
      fromUser: UserData,
    },
  ],
  2: [
    {
      id: generateRandId(),
      status: "succeed",
      type: "text",
      sendTime: 1679020034372,
      content: "医生，我有点头晕",
      toContactId: 2,
      fromUser: UserData,
    },
    {
      id: generateRandId(),
      status: "succeed",
      type: "text",
      sendTime: 1679020034372,
      content: "有低血压病史吗。",
      toContactId: 2,
      fromUser: getContact(2),
    },
    {
      id: generateRandId(),
      status: "succeed",
      type: "text",
      sendTime: 1679020034372,
      content: "没有",
      toContactId: 2,
      fromUser: UserData,
    },
    {
      id: generateRandId(),
      status: "succeed",
      type: "text",
      sendTime: 1679020034372,
      content: "那多休息，多膳食",
      toContactId: 2,
      fromUser: getContact(2),
    },
    {
      id: generateRandId(),
      status: "succeed",
      type: "text",
      sendTime: 1679020034372,
      content: "谢谢",
      toContactId: 2,
      fromUser: UserData,
    },
  ]

};
